Skip to content

feat: Add batch blacklist methods for types and string names in Reflector#54

Merged
IvanMurzak merged 2 commits into
mainfrom
feature/add-blacklisted-types-by-string
Jan 10, 2026
Merged

feat: Add batch blacklist methods for types and string names in Reflector#54
IvanMurzak merged 2 commits into
mainfrom
feature/add-blacklisted-types-by-string

Conversation

@IvanMurzak
Copy link
Copy Markdown
Owner

@IvanMurzak IvanMurzak commented Jan 10, 2026

This pull request adds comprehensive support for batch blacklisting of types, both by Type and by string type name, to the Reflector's converter system. It introduces new methods for blacklisting multiple types at once, improves cache invalidation logic, and adds extensive unit tests to ensure correct behavior, including handling of nulls, duplicates, and derived types.

Batch Blacklisting Functionality

  • Added BlacklistTypes(params Type[] types) to allow blacklisting multiple types at once, with logic to ignore nulls, deduplicate, and only invalidate the cache if new types are added.
  • Added BlacklistTypes(params string[] typeFullNames) and BlacklistType(string typeFullName) to allow blacklisting by string type names, resolving types using TypeUtils.GetType, and handling invalid names gracefully.
  • Ensured that cache invalidation occurs only when the blacklist actually changes, improving performance for repeated or redundant calls.

Unit Testing Enhancements

  • Added a comprehensive set of unit tests covering batch blacklisting with both Type and string names, handling of nulls, empty arrays, duplicates, derived types, generic types, and cache invalidation.

Utilities and Imports

  • Added import of com.IvanMurzak.ReflectorNet.Utils to support type resolution by string name.

@IvanMurzak IvanMurzak self-assigned this Jan 10, 2026
@IvanMurzak IvanMurzak added the enhancement New feature or request label Jan 10, 2026
@IvanMurzak IvanMurzak requested a review from Copilot January 10, 2026 10:50
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 10, 2026

Test Results

    2 files  ± 0      2 suites  ±0   8m 9s ⏱️ -26s
1 138 tests +19  1 138 ✅ +19  0 💤 ±0  0 ❌ ±0 
2 276 runs  +38  2 276 ✅ +38  0 💤 ±0  0 ❌ ±0 

Results for commit 6c053a0. ± Comparison against base commit c89ddf7.

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds batch blacklisting functionality to the Reflector's converter system, allowing multiple types to be blacklisted in a single operation, either by Type objects or by string type names. The implementation includes optimized cache invalidation that only triggers when new types are actually added to the blacklist.

Changes:

  • Added batch blacklisting methods (BlacklistTypes) for both Type[] and string[] parameters
  • Added string-based single type blacklisting method (BlacklistType(string))
  • Added comprehensive unit tests covering edge cases like nulls, duplicates, empty arrays, and cache invalidation

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
ReflectorNet/src/Reflector/Reflector.Registry.cs Implements batch blacklisting methods with optimized cache invalidation logic, adds support for string-based type name blacklisting
ReflectorNet.Tests/src/ReflectorTests/IsTypeBlacklistedTests.cs Adds 16 comprehensive unit tests covering batch operations, string-based blacklisting, null handling, deduplication, and cache invalidation scenarios

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ReflectorNet/src/Reflector/Reflector.Registry.cs Outdated
Comment thread ReflectorNet.Tests/src/ReflectorTests/IsTypeBlacklistedTests.cs
Comment thread ReflectorNet.Tests/src/ReflectorTests/IsTypeBlacklistedTests.cs
Comment thread ReflectorNet/src/Reflector/Reflector.Registry.cs Outdated
Comment thread ReflectorNet/src/Reflector/Reflector.Registry.cs
Comment thread ReflectorNet/src/Reflector/Reflector.Registry.cs
@IvanMurzak IvanMurzak merged commit 4e1716f into main Jan 10, 2026
2 checks passed
@IvanMurzak IvanMurzak deleted the feature/add-blacklisted-types-by-string branch January 10, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants